package com.bsb.biz.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.bsb.base.mapper.BsbCardBuyExMapper;
import com.bsb.base.mapper.BsbCardBuyMapper;
import com.bsb.base.model.BsbCardBuy;
import com.bsb.base.model.BsbCardBuyExample;
import com.bsb.base.model.BsbCardBuyUserFirm;
import com.bsb.base.model.BsbFirmExample;
import com.bsb.base.model.BsbUserExample;


@Service
public class BsbCardBuyService{
	
	@Resource
	private BsbCardBuyMapper bsbCardBuyMapper;
	
	@Resource
	private BsbCardBuyExMapper bsbCardBuyExMapper;
	
	public void addBsbCardBuy(BsbCardBuy bsbCardBuy) {
		bsbCardBuyMapper.insertSelective(bsbCardBuy);
	}
	
	public void delBsbCardBuyByUuid(String uuid) {
		bsbCardBuyMapper.deleteByPrimaryKey(uuid);
	}
	
	public void updateBsbCardBuy(BsbCardBuy bsbCardBuy) {
		bsbCardBuyMapper.updateByPrimaryKeySelective(bsbCardBuy);
	}
	
	public BsbCardBuy getBsbCardBuyByUuid(String uuid) {
		return bsbCardBuyMapper.selectByPrimaryKey(uuid);
	}
	
	public List<BsbCardBuy> getPageBsbCardBuy(BsbCardBuyExample bsbCardBuyExample) {
		return bsbCardBuyMapper.selectPage(bsbCardBuyExample);
	}
	
	public int countBsbCardBuy(BsbCardBuyExample bsbCardBuyExample) {
		return bsbCardBuyMapper.countByExample(bsbCardBuyExample);
	}
	
	public List<BsbCardBuyUserFirm> getCardBuyUserFirms(BsbCardBuyExample example,BsbUserExample bsbUserExample,BsbFirmExample bsbFirmExample){
		
		return bsbCardBuyExMapper.selectCardBuyUserFirm(example, bsbUserExample, bsbFirmExample);
		
	}
	
	public int getCountCradBuyUserFirm(BsbCardBuyExample example,BsbUserExample bsbUserExample,BsbFirmExample bsbFirmExample){
		return bsbCardBuyExMapper.countCardBuyUserFirmByExample(example, bsbUserExample, bsbFirmExample);
	}
	
	
}
